<template>
  <div>
    <el-popover placement="bottom" trigger="hover">
      <div v-if="slotExists('content')">
        <slot name="content"></slot>
      </div>
      <img v-else :src="content" alt="" class="exampleimg" :style="{height:height}" />
      <div slot="reference" class="c_primary commhover">示例</div>
    </el-popover>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    content: {
      default: "",
    },
    height:{
      type:String,
      default:'',
    }
  },
  methods:{
    // 判断是否有slot
    slotExists(slotName) {
      return !!this.$slots[slotName];
    },
  }
};
</script>
<style lang="scss" scoped>
.exampleimg {
  max-height: 600px;
}
</style>